package cn.py.boot_lua.util.exception;

import cn.py.boot_lua.util.RETURN_CODE;

/**
 * @message 错误封装类
 * @author yzh
 */
public class BusinessException extends RuntimeException  {
    private int code;
    private String msg;

    public BusinessException() {
    }

    public BusinessException(RETURN_CODE RETURNCODE) {
        this(RETURNCODE.getCode(), RETURNCODE.getMsg());
    }

    public BusinessException(String msg) {
        super(msg);
        this.code = RETURN_CODE.RC201.getCode();
        this.msg = msg;
    }

    public BusinessException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}

